import request from '@/utils/request'

// 获取租金支付信息
export function getPayout(data) {
  return request({
    url: 'paymentPlan/queryAllDetails',
    method: 'get',
    params: data
  })
}

// 租金收取查询数据
export function queryContractList(payType, contractId, storeId, rentType, page, limit) {
  return request({
    url: 'paymentPlan/queryRentColletion',
    method: 'get',
    params: {
      payType,
      contractId,
      storeId,
      rentType,
      page,
      limit
    }
  })
}

export function queryRentColletion(rentType, page, limit, payType) {
  return request({
    url: 'paymentPlan/queryRentColletion',
    method: 'get',
    params: {
      rentType,
      page,
      limit,
      payType
    }
  })
}

// 获取流水
export function paymentMoney() {
  return request({
    url: 'paymentPlan/paymentMoney',
    method: 'get'
  })
}

// 查询收付款
export function payment(companyBankAccount) {
  return request({
    url: 'paymentPlan/payment',
    method: 'post',
    params: {
      companyBankAccount
    }
  })
}

// 删除收款信息
export function paymentPlanDelete(actualPaymentTime) {
  return request({
    url: 'paymentPlan/paymentPlanDelete',
    method: 'delete',
    params: {
      actualPaymentTime
    }
  })
}

// 提交批量收款
export function addPaymentPlan(paymentPlan) {
  console.log(JSON.stringify(paymentPlan))
  return request({
    url: 'paymentPlan/addPaymentPlan',
    method: 'post',
    params: {
      json: JSON.stringify(paymentPlan)
    }
  })
}

// 所有租金数据
// export function queryAllDetails() {
//
// }

